package com.glsc.ngateway.common.api.flowable.dto.param;

import com.glsc.ngateway.common.api.flowable.dto.demand.ParamCreateDtoBuilder;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ParamCreateDto implements Serializable {
//    {
//        "userid": "qqq",
//            "sysid": "am",
//            "processDefinitionKey": "Product",
//            "content": "{\"title\":\"中文名称标题\",\"comment\":\"批准\",\"money\":\"500\"}"
//    }

    @ApiModelProperty(value = "创建流程人员id")
    private String userid;

    @ApiModelProperty(value = "流程定义key")
    private String processDefinitionKey;

    @ApiModelProperty(value = "第三方系统名称")
    private String sysid;

    @ApiModelProperty(value = "流程表单内容")
    private String content;

    @ApiModelProperty(value = "流程发起评论")
    private String createComment;

    //"taskAssignee\":{\"userGroup\":\"lm1,lm2\"}
    @ApiModelProperty(value = "流程节点办理人")
    private Map<String, String> taskAssignee;

    @ApiModelProperty(value = "条件判断变量")
    private Map<String, String> conditionalVariable;

    @ApiModelProperty(value = "进入草稿节点标识，如进入草稿此字段赋值常量beginTask")
    private String createToTaskDefinitionKey;


    public ParamCreateDto(ParamCreateDtoBuilder builder) {
        this.userid = builder.getUserid();
        this.processDefinitionKey = builder.getProcessDefinitionKey();
        this.sysid = builder.getSysid();
        this.content = builder.getContentStr();
        this.createComment = builder.getCreateComment();
        this.taskAssignee = builder.getTaskAssignee();
        this.conditionalVariable = builder.getConditionalVariable();
//        this.createToTaskDefinitionKey = builder.getCreateToTaskDefinitionKey();
    }

}
